<% content_for :sitemap do %>
  <span class="current">Wiki</span>
<% end %>

<table class="table table-bordered table-striped table-condensed">
  <tr class="head">
    <td class="first">ID</td>
    <td style="width:200px">Slug</td>
    <td>Title</td>
    <td>at</td>
    <td>lock</td>
    <td>Version</td>
    <td style="width:80px;"></td>
  </tr>

<% @pages.each do |page| %>
  <tr class="<%= 'deleted' if !page.deleted_at.blank? %>">
    <td class="first"><%= page.id %></td>
    <td><%= page.slug %></td>
    <td><%= truncate(page.title, length: 30) %></td>
    <td><%= l page.created_at, format: :short %></td>
    <td><%= page.locked %></td>
    <td><%= page.version %></td>
    <td>
      <%= link_to '', admin_page_versions_path(page.id), class: "fa fa-clock-o", title: "修改记录" %>
    <%= link_to '', edit_admin_page_path(page), class: "fa fa-pencil" %>
    <%= link_to '', admin_page_path(page), 'data-confirm' => 'Are you sure?', method: :delete, class: "fa fa-trash" %></td>
  </tr>
<% end %>
</table>
<%= will_paginate @pages %>
